package week7Midex;

import java.util.Random;

public class PlaneInAirport implements AirPort {
    private Plane plane;

    public PlaneInAirport(Plane plane) {
        this.plane = plane;
    }

    @Override
    public void schedule() {
        //异步模型 有一个队列来做调度
        Random random = new Random();
        if(random.nextBoolean()){
            System.out.println("机场允许起飞");
            plane.takeOff();
        }else{
            System.out.println("机场不允许起飞");
        }
    }
}
